package com.fps.web.dao.impl;

import org.springframework.stereotype.Repository;

import com.fpswork.core.exception.exception.BusinessException;
import com.fpswork.core.model.PageEntity;
import com.fpswork.datamodel.basedao.BaseDao;
import com.fpswork.util.BeanUtils;
import com.fpswork.util.StringUtil;
import com.fps.web.dao.BaseUserLogDao;
import com.fps.web.model.BaseUserLog;
@Repository 
public class BaseUserLogDaoImpl extends BaseDao implements BaseUserLogDao{
    
    

	public PageEntity queryUserLogList(PageEntity pageEntity)  throws BusinessException{
		String sql="select * from BaseUserLog";
		pageEntity.setSql(sql);
		return  this.queryForPageEntity(pageEntity);
	}

	public BaseUserLog addUserLog(BaseUserLog baseUserLog)  throws BusinessException{
		//校验是否为空
		if(baseUserLog==null){
			throw new BusinessException("传入数据为空！");
		}
		if(StringUtil.isEmpty(baseUserLog.getId())){
			this.save(baseUserLog);
		}else{
			throw new BusinessException("已存在数据！");
		}
		return baseUserLog;
	}
	
}
